package com.webservice;

import com.domain.*;

import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import java.util.List;

@WebService(targetNamespace = "http://39.98.59.6/mmms_test/ws/order")
public interface OrderWebservice {

    /**
     * 根据id查询一个维修单概况
     * @param id
     * @return
     */
    @WebResult(name = "Maintenance_order")
    public Maintenance_order findOne(@WebParam(name = "id") Integer id);

    /**
     * 查找一个维修单所有的维修要求
     * @param id
     * @return
     */
    @WebResult(name = "Maintenance_requestList")
    public List<Maintenance_request> findAllRequest(@WebParam(name = "id")Integer id);

    /**
     * 查找一个维修单最终的维修清单
     * @param id
     * @return
     */
    @WebResult(name = "ExpenseDetailsList")
    public List<Expense_details> findxpenseDetailsByOrder(@WebParam(name = "id")Integer id);



    /**
     * 新增方法
     * 查询一个审核员所有待审批的维修单
     * @param approver_id
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findOrderReview(@WebParam(name = "approver_id") Integer approver_id);

    /**
     * 查找一个维修单所有的流程
     * @param id
     * @return
     */
    @WebResult(name = "Maintenance_processList")
    public List<Maintenance_process> findProcess(@WebParam(name = "id")Integer id);

    /**
     * 查找一个维修单的评价
     * @param id 维修单id
     * @return
     */
    @WebResult(name = "Evaluation")
    public Evaluation findEvaluation(@WebParam(name = "id")Integer id);


    /**
     * 查找一个维修单的追评
     * @param id
     * @return
     */
    @WebResult(name = "Additional_evaluationList")
    public List<Additional_evaluation> findAdditionalEvaluation(@WebParam(name = "id")Integer id);

    /**
     * 根据id查询一个维修单详情
     * @param id
     * @return
     */
    @WebResult(name = "Order_details")
    public Order_details findOrderDetails(@WebParam(name = "id") Integer id);

     /**
     * 根据维修单和公司状态查询目标维修单列表
     * @param order_state_id 维修单状态id
     * @param company_id  公司id
     * @param flag  为1时查询待竞单的维修单列表；为2时查询已竞单的维修单列表
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findByState(@WebParam(name = "order_state_id") Integer order_state_id,
                                               @WebParam(name = "company_id") Integer company_id,
                                               @WebParam(name = "flag") Integer flag);

    /**
     * 根据用户id按年月查询历史维修单
     * @param user_id
     * @param time
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findHistoryByUser(@WebParam(name = "user_id")Integer user_id,
                                                     @WebParam(name = "time") String time);

    /**
     * 根据用户id按年查询历史维修单
     * @param user_id
     * @param year
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findHistoryByUserYear(@WebParam(name = "user_id")Integer user_id,
                                                         @WebParam(name = "year") Integer year);


    /**
     * 根据用户id查询正在进行的维修单
     * @param user_id  用户id
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findOrderByUser(@WebParam(name = "user_id")Integer user_id);

    /**
     * 根据维修方id查询正在进行的维修单
     * @param user_id  用户id
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findOrderByUnit(@WebParam(name = "user_id")Integer user_id);

    /**
     * 根据设备id查询所有维修单
     * @param equipment_id
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findHOrderByEquipment(@WebParam(name = "equipment_id") Integer equipment_id);

    /**
     * 根据设备id查询所有维修单
     * @param equipment_id
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findOrderByEquipment(@WebParam(name = "equipment_id") Integer equipment_id);

    /**
     * 按部门、年月显示所有维修单
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findAll(@WebParam(name = "time") String time,
                                           @WebParam(name = "department_id") Integer department_id);

    /**
     * 按部门、年显示所有维修单
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findAllYear(@WebParam(name = "year") Integer year,
                                           @WebParam(name = "department_id") Integer department_id);


    /**
     * 根据年查询所有维修单
     * @param year
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findAllOrderByYear(@WebParam(name = "year") Integer year);

    /**
     * 按年月显示所有未完成维修单
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findAllOrderByTimeUnfinished(@WebParam(name = "time") String time);

    /**
     * 按年月显示所有已完成维修单
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findAllOrderByTimeFinished(@WebParam(name = "time") String time);

    /**
     * 按年月显示所有维修单
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findAllOrderByTime(@WebParam(name = "time") String time);

    /**
     * 根据单位查询所属维修单
     * @param insiderUnit_id
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findAllOrderByInsiderUnit(@WebParam(name = "insiderUnit_id")Integer insiderUnit_id);

    /**
     * 根据维修单名称模糊查询
     * @param order_name
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findOrderByName(@WebParam(name = "order_name") String order_name);


    /**
     * 根据维修单名称和部门模糊查询
     * @param order_name
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findDepartmentOrderByName(@WebParam(name = "department_id") Integer department_id,
                                                             @WebParam(name = "order_name") String order_name);


    /**
     * 根据单位和维修单名称模糊查询
     * @param insiderUnit_id
     * @param order_name
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findInsiderUnitOrderByName(@WebParam(name = "insiderUnit_id") Integer insiderUnit_id,
                                                              @WebParam(name = "order_name") String order_name);

    /**
     * 根据维修类型查询维修单
     * @param maintenance_type
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findOrderByType(@WebParam(name = "maintenance_type") Integer maintenance_type);


    /**
     * 查询所有正在进行的维修单
     * @return
     */
    @WebResult(name = "Maintenance_orderList")
    public List<Maintenance_order> findAllUnfinishedOrder();

}
